3.1.28 \(\int \frac {\text {sech}(x)}{a+b \cosh ^2(x)} \, dx\) [28]

Optimal. Leaf size=41 \[ \frac {\text {ArcTan}(\sinh (x))}{a}-\frac {\sqrt {b} \text {ArcTan}\left (\frac {\sqrt {b} \sinh (x)}{\sqrt {a+b}}\right )}{a \sqrt {a+b}} \]

[Out]

arctan(sinh(x))/a-arctan(sinh(x)*b^(1/2)/(a+b)^(1/2))*b^(1/2)/a/(a+b)^(1/2)

________________________________________________________________________________________

Rubi [A]
time = 0.04, antiderivative size = 41, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 13, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.308, Rules used = {3265, 400, 209, 211} \begin {gather*} \frac {\text {ArcTan}(\sinh (x))}{a}-\frac {\sqrt {b} \text {ArcTan}\left (\frac {\sqrt {b} \sinh (x)}{\sqrt {a+b}}\right )}{a \sqrt {a+b}} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sech[x]/(a + b*Cosh[x]^2),x]

[Out]

ArcTan[Sinh[x]]/a - (Sqrt[b]*ArcTan[(Sqrt[b]*Sinh[x])/Sqrt[a + b]])/(a*Sqrt[a + b])

Rule 209

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[b, 2]))*ArcTan[Rt[b, 2]*(x/Rt[a, 2])], x] /;
 FreeQ[{a, b}, x] && PosQ[a/b] && (GtQ[a, 0] || GtQ[b, 0])

Rule 211

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[a/b, 2]/a)*ArcTan[x/Rt[a/b, 2]], x] /; FreeQ[{a, b}, x]
&& PosQ[a/b]

Rule 400

Int[1/(((a_) + (b_.)*(x_)^(n_))*((c_) + (d_.)*(x_)^(n_))), x_Symbol] :> Dist[b/(b*c - a*d), Int[1/(a + b*x^n),
 x], x] - Dist[d/(b*c - a*d), Int[1/(c + d*x^n), x], x] /; FreeQ[{a, b, c, d, n}, x] && NeQ[b*c - a*d, 0]

Rule 3265

Int[sin[(e_.) + (f_.)*(x_)]^(m_.)*((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)]^2)^(p_.), x_Symbol] :> With[{ff = Free
Factors[Cos[e + f*x], x]}, Dist[-ff/f, Subst[Int[(1 - ff^2*x^2)^((m - 1)/2)*(a + b - b*ff^2*x^2)^p, x], x, Cos
[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, p}, x] && IntegerQ[(m - 1)/2]

Rubi steps

\begin {align*} \int \frac {\text {sech}(x)}{a+b \cosh ^2(x)} \, dx &=\text {Subst}\left (\int \frac {1}{\left (1+x^2\right ) \left (a+b+b x^2\right )} \, dx,x,\sinh (x)\right )\\ &=\frac {\text {Subst}\left (\int \frac {1}{1+x^2} \, dx,x,\sinh (x)\right )}{a}-\frac {b \text {Subst}\left (\int \frac {1}{a+b+b x^2} \, dx,x,\sinh (x)\right )}{a}\\ &=\frac {\tan ^{-1}(\sinh (x))}{a}-\frac {\sqrt {b} \tan ^{-1}\left (\frac {\sqrt {b} \sinh (x)}{\sqrt {a+b}}\right )}{a \sqrt {a+b}}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.07, size = 45, normalized size = 1.10 \begin {gather*} \frac {\sqrt {b} \text {ArcTan}\left (\frac {\sqrt {a+b} \text {csch}(x)}{\sqrt {b}}\right )}{a \sqrt {a+b}}+\frac {2 \text {ArcTan}\left (\tanh \left (\frac {x}{2}\right )\right )}{a} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sech[x]/(a + b*Cosh[x]^2),x]

[Out]

(Sqrt[b]*ArcTan[(Sqrt[a + b]*Csch[x])/Sqrt[b]])/(a*Sqrt[a + b]) + (2*ArcTan[Tanh[x/2]])/a

________________________________________________________________________________________

Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(84\) vs. \(2(33)=66\).
time = 0.73, size = 85, normalized size = 2.07

method result size
default \(\frac {2 \arctan \left (\tanh \left (\frac {x}{2}\right )\right )}{a}-\frac {2 b \left (\frac {\arctan \left (\frac {2 \sqrt {a +b}\, \tanh \left (\frac {x}{2}\right )+2 \sqrt {a}}{2 \sqrt {b}}\right )}{2 \sqrt {a +b}\, \sqrt {b}}+\frac {\arctan \left (\frac {2 \sqrt {a +b}\, \tanh \left (\frac {x}{2}\right )-2 \sqrt {a}}{2 \sqrt {b}}\right )}{2 \sqrt {a +b}\, \sqrt {b}}\right )}{a}\) \(85\)
risch \(\frac {i \ln \left ({\mathrm e}^{x}+i\right )}{a}-\frac {i \ln \left ({\mathrm e}^{x}-i\right )}{a}+\frac {\sqrt {-b \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 x}-\frac {2 \sqrt {-b \left (a +b \right )}\, {\mathrm e}^{x}}{b}-1\right )}{2 \left (a +b \right ) a}-\frac {\sqrt {-b \left (a +b \right )}\, \ln \left ({\mathrm e}^{2 x}+\frac {2 \sqrt {-b \left (a +b \right )}\, {\mathrm e}^{x}}{b}-1\right )}{2 \left (a +b \right ) a}\) \(106\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sech(x)/(a+b*cosh(x)^2),x,method=_RETURNVERBOSE)

[Out]

2/a*arctan(tanh(1/2*x))-2/a*b*(1/2/(a+b)^(1/2)/b^(1/2)*arctan(1/2*(2*(a+b)^(1/2)*tanh(1/2*x)+2*a^(1/2))/b^(1/2
))+1/2/(a+b)^(1/2)/b^(1/2)*arctan(1/2*(2*(a+b)^(1/2)*tanh(1/2*x)-2*a^(1/2))/b^(1/2)))

________________________________________________________________________________________

Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sech(x)/(a+b*cosh(x)^2),x, algorithm="maxima")

[Out]

2*arctan(e^x)/a - 2*integrate((b*e^(3*x) + b*e^x)/(a*b*e^(4*x) + a*b + 2*(2*a^2 + a*b)*e^(2*x)), x)

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 115 vs. \(2 (33) = 66\).
time = 0.40, size = 360, normalized size = 8.78 \begin {gather*} \left [\frac {\sqrt {-\frac {b}{a + b}} \log \left (\frac {b \cosh \left (x\right )^{4} + 4 \, b \cosh \left (x\right ) \sinh \left (x\right )^{3} + b \sinh \left (x\right )^{4} - 2 \, {\left (2 \, a + 3 \, b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, b \cosh \left (x\right )^{2} - 2 \, a - 3 \, b\right )} \sinh \left (x\right )^{2} + 4 \, {\left (b \cosh \left (x\right )^{3} - {\left (2 \, a + 3 \, b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) - 4 \, {\left ({\left (a + b\right )} \cosh \left (x\right )^{3} + 3 \, {\left (a + b\right )} \cosh \left (x\right ) \sinh \left (x\right )^{2} + {\left (a + b\right )} \sinh \left (x\right )^{3} - {\left (a + b\right )} \cosh \left (x\right ) + {\left (3 \, {\left (a + b\right )} \cosh \left (x\right )^{2} - a - b\right )} \sinh \left (x\right )\right )} \sqrt {-\frac {b}{a + b}} + b}{b \cosh \left (x\right )^{4} + 4 \, b \cosh \left (x\right ) \sinh \left (x\right )^{3} + b \sinh \left (x\right )^{4} + 2 \, {\left (2 \, a + b\right )} \cosh \left (x\right )^{2} + 2 \, {\left (3 \, b \cosh \left (x\right )^{2} + 2 \, a + b\right )} \sinh \left (x\right )^{2} + 4 \, {\left (b \cosh \left (x\right )^{3} + {\left (2 \, a + b\right )} \cosh \left (x\right )\right )} \sinh \left (x\right ) + b}\right ) + 4 \, \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right )}{2 \, a}, -\frac {\sqrt {\frac {b}{a + b}} \arctan \left (\frac {1}{2} \, \sqrt {\frac {b}{a + b}} {\left (\cosh \left (x\right ) + \sinh \left (x\right )\right )}\right ) + \sqrt {\frac {b}{a + b}} \arctan \left (\frac {{\left (b \cosh \left (x\right )^{3} + 3 \, b \cosh \left (x\right ) \sinh \left (x\right )^{2} + b \sinh \left (x\right )^{3} + {\left (4 \, a + 3 \, b\right )} \cosh \left (x\right ) + {\left (3 \, b \cosh \left (x\right )^{2} + 4 \, a + 3 \, b\right )} \sinh \left (x\right )\right )} \sqrt {\frac {b}{a + b}}}{2 \, b}\right ) - 2 \, \arctan \left (\cosh \left (x\right ) + \sinh \left (x\right )\right )}{a}\right ] \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sech(x)/(a+b*cosh(x)^2),x, algorithm="fricas")

[Out]

[1/2*(sqrt(-b/(a + b))*log((b*cosh(x)^4 + 4*b*cosh(x)*sinh(x)^3 + b*sinh(x)^4 - 2*(2*a + 3*b)*cosh(x)^2 + 2*(3
*b*cosh(x)^2 - 2*a - 3*b)*sinh(x)^2 + 4*(b*cosh(x)^3 - (2*a + 3*b)*cosh(x))*sinh(x) - 4*((a + b)*cosh(x)^3 + 3
*(a + b)*cosh(x)*sinh(x)^2 + (a + b)*sinh(x)^3 - (a + b)*cosh(x) + (3*(a + b)*cosh(x)^2 - a - b)*sinh(x))*sqrt
(-b/(a + b)) + b)/(b*cosh(x)^4 + 4*b*cosh(x)*sinh(x)^3 + b*sinh(x)^4 + 2*(2*a + b)*cosh(x)^2 + 2*(3*b*cosh(x)^
2 + 2*a + b)*sinh(x)^2 + 4*(b*cosh(x)^3 + (2*a + b)*cosh(x))*sinh(x) + b)) + 4*arctan(cosh(x) + sinh(x)))/a, -
(sqrt(b/(a + b))*arctan(1/2*sqrt(b/(a + b))*(cosh(x) + sinh(x))) + sqrt(b/(a + b))*arctan(1/2*(b*cosh(x)^3 + 3
*b*cosh(x)*sinh(x)^2 + b*sinh(x)^3 + (4*a + 3*b)*cosh(x) + (3*b*cosh(x)^2 + 4*a + 3*b)*sinh(x))*sqrt(b/(a + b)
)/b) - 2*arctan(cosh(x) + sinh(x)))/a]

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\operatorname {sech}{\left (x \right )}}{a + b \cosh ^{2}{\left (x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sech(x)/(a+b*cosh(x)**2),x)

[Out]

Integral(sech(x)/(a + b*cosh(x)**2), x)

________________________________________________________________________________________

Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sech(x)/(a+b*cosh(x)^2),x, algorithm="giac")

[Out]

Exception raised: TypeError >> An error occurred running a Giac command:INPUT:sage2:=int(sage0,sageVARx):;OUTP
UT:Warning, need to choose a branch for the root of a polynomial with parameters. This might be wrong.The choi
ce was done

________________________________________________________________________________________

Mupad [B]
time = 1.30, size = 208, normalized size = 5.07 \begin {gather*} \frac {2\,\mathrm {atan}\left (\frac {{\mathrm {e}}^x\,\left (16\,{\left (a^2\right )}^{3/2}+9\,b^2\,\sqrt {a^2}+24\,a\,b\,\sqrt {a^2}\right )}{16\,a^3+24\,a^2\,b+9\,a\,b^2}\right )}{\sqrt {a^2}}-\frac {\sqrt {b}\,\left (2\,\mathrm {atan}\left (\frac {\sqrt {b}\,{\mathrm {e}}^x\,\sqrt {a^2\,\left (a+b\right )}}{2\,a\,\left (a+b\right )}\right )+2\,\mathrm {atan}\left (\frac {4\,a^4\,{\mathrm {e}}^x+8\,a^3\,b\,{\mathrm {e}}^x+4\,a^2\,b^2\,{\mathrm {e}}^x-b\,{\mathrm {e}}^x\,\sqrt {a^2\,\left (a+b\right )}\,\sqrt {a^3+b\,a^2}+b\,{\mathrm {e}}^{3\,x}\,\sqrt {a^2\,\left (a+b\right )}\,\sqrt {a^3+b\,a^2}}{\sqrt {b}\,\sqrt {a^2\,\left (a+b\right )}\,\left (2\,a^2+2\,b\,a\right )}\right )\right )}{2\,\sqrt {a^3+b\,a^2}} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cosh(x)*(a + b*cosh(x)^2)),x)

[Out]

(2*atan((exp(x)*(16*(a^2)^(3/2) + 9*b^2*(a^2)^(1/2) + 24*a*b*(a^2)^(1/2)))/(9*a*b^2 + 24*a^2*b + 16*a^3)))/(a^
2)^(1/2) - (b^(1/2)*(2*atan((b^(1/2)*exp(x)*(a^2*(a + b))^(1/2))/(2*a*(a + b))) + 2*atan((4*a^4*exp(x) + 8*a^3
*b*exp(x) + 4*a^2*b^2*exp(x) - b*exp(x)*(a^2*(a + b))^(1/2)*(a^2*b + a^3)^(1/2) + b*exp(3*x)*(a^2*(a + b))^(1/
2)*(a^2*b + a^3)^(1/2))/(b^(1/2)*(a^2*(a + b))^(1/2)*(2*a*b + 2*a^2)))))/(2*(a^2*b + a^3)^(1/2))

________________________________________________________________________________________